//package com.kyw.controller;
//
//import com.ln.model.dto.system.LoginDto;
//import com.ln.model.entity.system.SysUser;
//import com.ln.model.vo.common.Result;
//import com.ln.model.vo.common.ResultCodeEnum;
//import com.ln.model.vo.system.LoginVo;
//import com.ln.model.vo.system.SysMenuVo;
//import com.ln.model.vo.system.ValidateCodeVo;
//import com.ln.service.SysMenuService;
//import com.ln.service.SysUserService;
//import com.ln.service.ValidateCodeService;
//import io.swagger.v3.oas.annotations.Operation;
//import io.swagger.v3.oas.annotations.tags.Tag;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.List;
//
//@Tag(name = "用户接口")
//@RestController
//@RequestMapping(value = "/admin/system/index")
////@CrossOrigin(allowCredentials = "true" , originPatterns = "*" , allowedHeaders = "*")
//public class IndexController {
//    @Autowired
//    private SysUserService sysUserService;
//    @Autowired
//    private ValidateCodeService validateCodeService;
//    @Autowired
//    private SysMenuService sysMenuService;
//    //图片验证
//    @GetMapping(value = "/generateValidateCode")
//    public Result<ValidateCodeVo> generateValidateCode() {
//        ValidateCodeVo validateCodeVo = validateCodeService.generateValidateCode();
//        return Result.build(validateCodeVo , ResultCodeEnum.SUCCESS) ;
//    }
//    //登录
//    @Operation(summary = "登录接口")
//    @PostMapping(value = "/login")
//    public Result<LoginVo> login(@RequestBody LoginDto loginDto) {
//        LoginVo loginVo=sysUserService.login(loginDto);
//        return Result.build(loginVo, ResultCodeEnum.SUCCESS);
//    }
//    //
//    @GetMapping(value = "/getUserInfo")
//    public Result<SysUser> getUserInfo(@RequestHeader(name = "token") String token) {
//        SysUser sysUser = sysUserService.getUserInfo(token) ;
//        return Result.build(sysUser , ResultCodeEnum.SUCCESS) ;
//    }
//    @GetMapping(value = "/logout")
//    public Result logout(@RequestHeader(value = "token") String token) {
//        sysUserService.logout(token) ;
//        return Result.build(null , ResultCodeEnum.SUCCESS) ;
//    }
//    /**
//     * 动态菜单
//     */
//    @GetMapping("/menus")
//    public Result menus() {
//        List<SysMenuVo> sysMenuVoList =  sysMenuService.findUserMenuList() ;
//        return Result.build(sysMenuVoList , ResultCodeEnum.SUCCESS) ;
//    }
//}
